package cn.funnyxb.powerremember;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import cn.funnyxb.powerremember.beans.AlarmInfo;
import cn.funnyxb.powerremember.db.tables.Tbholder_alarmsinfo;
import cn.funnyxb.powerremember.uis.task.taskEdit.alarm.AlarmHelper;
import cn.funnyxb.tools.appFrame.AppDBConfig;
import cn.funnyxb.tools.appFrame.database.DBHolder;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;

public class Autorun extends BroadcastReceiver
{
  private void log(String paramString)
  {
    Debuger.log("autorun", paramString);
  }

  private void regAlarm(Context paramContext)
  {
    DBHolder localDBHolder;
    try
    {
      localDBHolder = new DBHolder(paramContext, "powerremember.db", AppDBConfig.DBVERSION, null);
    }
    catch (Exception localException2)
    {
      try
      {
        Tbholder_alarmsinfo localTbholder_alarmsinfo = new Tbholder_alarmsinfo(localDBHolder);
        log("db=" + localDBHolder + ",tb=" + localTbholder_alarmsinfo);
        if ((localDBHolder == null) || (localTbholder_alarmsinfo == null));
        label64: Cursor localCursor;
        do
        {
          while (true)
          {
            return;
            localException2 = localException2;
          }
          localCursor = localTbholder_alarmsinfo.queryAll();
        }
        while ((localCursor == null) || (localCursor.getCount() <= 0));
        localCursor.moveToFirst();
        AlarmHelper localAlarmHelper = new AlarmHelper(paramContext);
        AlarmInfo localAlarmInfo;
        do
        {
          if (localCursor.isAfterLast())
          {
            localCursor.close();
            localDBHolder.closeDB();
          }
          localAlarmInfo = AlarmInfo.parseFromCursor(localCursor);
          localCursor.moveToNext();
        }
        while (!(localAlarmInfo.isEnabled()));
        localAlarmHelper.regAlarm(localAlarmInfo);
      }
      catch (Exception localException1)
      {
        break label64:
      }
    }
  }

  public void onReceive(Context paramContext, Intent paramIntent)
  {
    regAlarm(paramContext);
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.Autorun
 * JD-Core Version:    0.5.3
 */